#include "base/simapi.h"

void print (double d) {
    Sim_PrintDouble("%.13a\n",d);
    Sim_PrintDouble("%e\n",d);
    Sim_PrintDouble("%f\n",d);
    Sim_PrintDouble("%g\n",d);
    Sim_Print0("\n");
}

void mainX(int argc, const char** const argv, const char **envp) {
    Sim_Print1("%d\n", Sim_GetClock()); 
    Sim_Print1("%d\n", Sim_GetClock()); 

    Sim_Print1("%d\n", 0); 
    Sim_Print2("%d %d\n", 0, 1); 
    Sim_Print3("%d %d %d\n", 0, 1, 2); 
    Sim_Print4("%d %d %d %d\n", 0, 1, 2, 3); 
    Sim_Print5("%d %d %d %d %d\n", 0, 1, 2, 3, 4); 
    Sim_Print6("%d %d %d %d %d %d\n", 0, 1, 2, 3, 4, 5); 
    Sim_Print7("%d %d %d %d %d %d %d\n", 0, 1, 2, 3, 4, 5, 6); 
    Sim_Print8("%d %d %d %d %d %d %d %d\n", 0, 1, 2, 3, 4, 5, 6, 7); 
    Sim_Print("%d %d %d %d %d %d %d %d\n\n", 0, 1, 2, 3, 4, 5, 6, 7); 

    print(5);
    print(0.5);
    print(0.05);
    print(8.01e-03);

    // make sure correct output with embedded newlines and prefixing
    Sim_Print("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 0, 1, 2, 3, 4, 5, 6, 7); 
    Sim_Print("%d %d %d %d %d %d %d %d\n\n", 0, 1, 2, 3, 4, 5, 6, 7); 

    // testing special case of 0x80000000*-1=0x80000000
    Sim_Print1("%d\n", 0x80000000); 

}
